USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0004_VALIDA_CUOTAS]    Script Date: 11/25/2011 11:56:49 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WASP_M0004_VALIDA_CUOTAS]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[WASP_M0004_VALIDA_CUOTAS]
GO

USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0004_VALIDA_CUOTAS]    Script Date: 11/25/2011 11:56:49 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[WASP_M0004_VALIDA_CUOTAS] 

AS
BEGIN
	SELECT  
		SUC,
		CRCREDITO,
		RUTTRABAJA,
		FNACITRABA,
		SEXOTRABAJ,
		CRMONTO,
		CRCUOTAS,
		CRTASA,
		CRCLASE,
		CRFECAPROB,
		TIPO_TRABAJADOR

	INTO DBO.ERROR_CUOTAS
	FROM DBO.as_credi_vigente_temp
	WHERE LEN(CRCUOTAS)> 2

	DELETE 
	FROM DBO.as_credi_vigente_temp
	WHERE LEN(CRCUOTAS)> 2
END

GO


